package user.zc.data;

import lombok.Data;

import java.util.Locale;

/**
 * @author zhouchuang
 * @date 2023/8/8 17:43
 */
@Data
public class Column {
    /**字段名称*/
    private String fieldName;

    /**属性名称*/
    private String columnName;

    /**字段备注描述信息*/
    private String comments;

    /**字段长度*/
    private int columnSize;

    private int scale;

    private String type;

    /**字段类型*/
    private EntityMapping em;

    /**字段类型*/
    private boolean isPk;

    public Column(String columnName, String comments, int columnSize, int scale, String type) {
        this.columnName = columnName;
        this.comments = comments;
        this.columnSize = columnSize;
        this.scale = scale;
        this.type = type;
    }

    public String getFirstUpperFieldName(){
        return fieldName.substring(0,1).toUpperCase(Locale.ROOT)+fieldName.substring(1);
    }
}
